#!/usr/bin/env python
# -*- coding: UTF-8 -*-
"""
@File    ：graph.py
@Author  ：平
@Date    ：2025/9/28 14:00 
"""

from langgraph.graph import END, START, StateGraph

from app.graph.node import coordinator, retrieval, complete
from app.graph.state import State


def _get_builder():
    builder = StateGraph(State)
    builder.add_node('coordinator', coordinator)
    builder.add_node('retrieval', retrieval)
    builder.add_node('complete', complete)
    builder.add_edge(START, 'coordinator')
    builder.add_edge('retrieval', END)
    builder.add_edge('complete', END)
    return builder


_builder = _get_builder()
graph = _builder.compile()

if __name__ == '__main__':
    graph.get_graph().draw_mermaid_png(output_file_path="./docs/output.png")
